package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ghy
 * @version 1.0.1
 * @date 2023-04-20 12:26:32
 */
@Mapper
public interface DishFlavorMapper {

    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(Long dishId);

    @Select("select * from dish_flavor where dish_id = #{dishId}")
    List<DishFlavor> getByDishId(Long dishId);

    void deleteByDishIds(@Param("dishIds") List<Long> ids);

    void batchInsert(@Param("flavors") List<DishFlavor> flavors);


}
